package com.drm.netschool.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.drm.netschool.entity.DrmCourseOffline;
import com.drm.netschool.entity.DrmCourseOfflineExample;

public interface DrmCourseOfflineMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_offline
     *
     * @mbggenerated Sat Nov 29 11:53:23 CST 2014
     */
    int countByExample(DrmCourseOfflineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_offline
     *
     * @mbggenerated Sat Nov 29 11:53:23 CST 2014
     */
    int deleteByExample(DrmCourseOfflineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_offline
     *
     * @mbggenerated Sat Nov 29 11:53:23 CST 2014
     */
    @Delete({
        "delete from drm_course_offline",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_offline
     *
     * @mbggenerated Sat Nov 29 11:53:23 CST 2014
     */
    @Insert({
        "insert into drm_course_offline (id, course_id, ",
        "course_prvoid, course_cityid, ",
        "course_provnm, course_citynm, ",
        "course_address, course_setting, ",
        "course_startdt, ",
        "course_limitdt, ",
        "course_limit, course_desc, ",
        "course_teacher_desc)",
        "values (#{id,jdbcType=BIGINT}, #{courseId,jdbcType=BIGINT}, ",
        "#{coursePrvoid,jdbcType=VARCHAR}, #{courseCityid,jdbcType=VARCHAR}, ",
        "#{courseProvnm,jdbcType=VARCHAR}, #{courseCitynm,jdbcType=VARCHAR}, ",
        "#{courseAddress,jdbcType=VARCHAR}, #{courseSetting,jdbcType=VARCHAR}, ",
        "#{courseStartdt,jdbcType=TIMESTAMP }, ",
        "#{courseLimitdt,jdbcType=TIMESTAMP }, ",
        "#{courseLimit,jdbcType=INTEGER}, #{courseDesc,jdbcType=VARCHAR}, ",
        "#{courseTeacherDesc,jdbcType=VARCHAR})"
    })
    int insert(DrmCourseOffline record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_offline
     *
     * @mbggenerated Sat Nov 29 11:53:23 CST 2014
     */
    int insertSelective(DrmCourseOffline record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_offline
     *
     * @mbggenerated Sat Nov 29 11:53:23 CST 2014
     */
    List<DrmCourseOffline> selectByExample(DrmCourseOfflineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_offline
     *
     * @mbggenerated Sat Nov 29 11:53:23 CST 2014
     */
    @Select({
        "select",
        "id, course_id, course_prvoid, course_cityid, course_provnm, course_citynm, course_address, ",
        "course_setting, course_startdt, course_limitdt, course_limit, course_desc, course_teacher_desc",
        "from drm_course_offline",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    DrmCourseOffline selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_offline
     *
     * @mbggenerated Sat Nov 29 11:53:23 CST 2014
     */
    int updateByExampleSelective(@Param("record") DrmCourseOffline record, @Param("example") DrmCourseOfflineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_offline
     *
     * @mbggenerated Sat Nov 29 11:53:23 CST 2014
     */
    int updateByExample(@Param("record") DrmCourseOffline record, @Param("example") DrmCourseOfflineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_offline
     *
     * @mbggenerated Sat Nov 29 11:53:23 CST 2014
     */
    int updateByPrimaryKeySelective(DrmCourseOffline record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_course_offline
     *
     * @mbggenerated Sat Nov 29 11:53:23 CST 2014
     */
    @Update({
        "update drm_course_offline",
        "set course_id = #{courseId,jdbcType=BIGINT},",
          "course_prvoid = #{coursePrvoid,jdbcType=VARCHAR},",
          "course_cityid = #{courseCityid,jdbcType=VARCHAR},",
          "course_provnm = #{courseProvnm,jdbcType=VARCHAR},",
          "course_citynm = #{courseCitynm,jdbcType=VARCHAR},",
          "course_address = #{courseAddress,jdbcType=VARCHAR},",
          "course_setting = #{courseSetting,jdbcType=VARCHAR},",
          "course_startdt = #{courseStartdt,jdbcType=TIMESTAMP },",
          "course_limitdt = #{courseLimitdt,jdbcType=TIMESTAMP },",
          "course_limit = #{courseLimit,jdbcType=INTEGER},",
          "course_desc = #{courseDesc,jdbcType=VARCHAR},",
          "course_teacher_desc = #{courseTeacherDesc,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DrmCourseOffline record);
}